//
//  BaseViewController.h
//  LotteryClient
//
//  Created by SunYu on 14-2-5.
//  Copyright (c) 2014年 SunYu. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BaseBusiness.h"
#import "FileCache.h"
#import "TabBarItem.h"
#import "NavigationBar+Background.h"
#import "BaseFramework.h"
#import "BaseView.h"
#import "NavigationController.h"
#import "TipView.h"
#import "ActivityIndicatorCoverView.h"
#import "TipHandler.h"

@class TabViewController;
@class SideslipViewController;

@interface BaseViewController : UIViewController <BaseViewDelegate, NavigationControllerDelegate>
{
    TabBarItem *_customTabBarItem;
    __block BOOL _requesting;
}

AS_STATIC_PROPERTY_INT(baseType)

@property (nonatomic, strong)ActivityIndicatorCoverView *coverView;


@property(nonatomic, readonly) NSString      *identifier;
@property(nonatomic, strong) TabBarItem      *customTabBarItem;
@property(nonatomic, strong) UIBarButtonItem *defaultBackButtonItem;
@property(nonatomic, strong) UIBarButtonItem *defaultRefreshButtonItem;
@property(nonatomic, assign) BOOL            hasNavigationBar;
@property(nonatomic, assign) CGFloat         navigationBarHeight;
@property(nonatomic, strong, readonly) NavigationBar    *navigationBar;

@property(nonatomic, weak) TabViewController    *customTabViewController;
@property(nonatomic, weak) NavigationController *customNavigationController;
@property(nonatomic, weak) SideslipViewController *sideslipViewController;


@property(nonatomic, assign) int pageIndex;
@property(nonatomic, assign) BOOL requesting;
@property(nonatomic, readonly) BOOL isRefreshData;


@property(nonatomic, assign,getter=isFirstAppear) BOOL firstAppear; 


- (void)back;

- (void)showErrorMessage:(NSString *)errorMessage;
- (void)showAlertMessage:(NSString *)alertMessage;
- (void)showSucceedMessage:(NSString *)succedMessage;

- (void)showProgressHUDWithMessage:(NSString *)message;

- (void)showProgressHUDCompleteMessage:(NSString *)message;
- (void)showAlertTip:(NSString *)tip;

- (void)showHandleDataDefaultMessage;

- (void)showHandleDataCompleteDefaultMessage;

- (void)requestDataFromNet;

- (void)refreshData;


- (CGRect)viewContentFrame;

- (void)setNavigationTitle:(NSString *)title;
@end